security: SQLi and XSS hardening (main) - #319
Open
somethingwithproof wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the syslog plugin against SQL injection in alert evaluation and reduces stored-XSS risk when rendering syslog statistics, aligning with VULN-008 / VULN-009.
Changes:
- Converted several syslog alert match queries to use prepared statements with bound parameters.
- Added a
syslog_db_fetch_assoc_prepared()wrapper to run prepared SELECTs against the syslog DB connection. - Escaped host/program values when rendering the statistics table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
syslog.php |
Escapes host/program output in the statistics table rendering. |
syslog_process.php |
Reworks alert match SQL to use parameter binding and prepared fetch helpers. |
database.php |
Adds a prepared-query wrapper for associative fetches on the syslog DB connection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements prepared statements for SQL alerts and systematic HTML escaping for syslog statistics to prevent SQLi and stored XSS. Addresses VULN-008 and VULN-009.